<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <div v-bind:style="{border: borderStyle,width: widthStyle,height: heightStyle,background: backgroundStyle}"></div>
    <div v-bind:style="objectClass"></div>
    <button @click="handle">切换</button>
</div>
<script type="text/javascript" src="js/vue.min.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            borderStyle: '1px solid red',
            widthStyle: '100px',
            heightStyle: '200px',
            backgroundStyle: 'yellow',
            objectClass: {
                border: '1px solid red',
                width: '200px',
                height: '100px',
                background:"black"
            }
        },
        methods: {
            handle: function () {
                this.heightStyle = '100px';
                this.backgroundStyle="pink";
                this.objectClass.width= '100px'
                this.objectClass.background="grey";
            }
        }
    })
</script>
</body>
</html>